<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>FileHelpers Library - Marcos Meli</TITLE>
<LINK href="/favicon.ico" rel="SHORTCUT ICON"><LINK 
href="global.css" type=text/css 
rel=stylesheet>
<link type="text/css" rel="stylesheet" href="SyntaxHighlighter.css"></link>

<meta NAME="Description"        content="An easy to use .NET library to read/write data from fixed length or delimited files or streams. It has support to import/export data from different data sources." />
<meta name="Author"             content="Marcos Meli" />
<meta NAME="keywords" Content="filehelpers,CSV,Marcos_Meli,C#,free,opensource,Devoo.net,Delimited Files,Import/Export">
<meta NAME="Copyright" CONTENT="Copyright 2005-07 to Marcos Meli - www.Devoo.net. All Rights Reserved.">

</HEAD>
<BODY   text=black vLink=purple aLink=red link=blue 
bgColor=white leftMargin=0 topMargin=0>

		{$HEADER$}


<table width="100%" cellpadding="5" cellspacing="5">
<tr><td><div id=contentdiv> 
  <h2>
      CommonEngine</h2>
  <blockquote>
          <p>
              You can use this class as a short cut to the common operations, now have only the
              basic methods but in the feature will contains a full list of common operations.</p>
      <p>
          You can use this class like this</p>
          <blockquote>
<textarea name="code" class="c#">

// to read use:
Orders[] res = CommonEngine.ReadFile(typeof(Orders),&quot;TestIn.txt&quot;) as Orders[];

// to read sorted:
Orders[] res = CommonEngine.ReadSortedFile(typeof(Orders),&quot;TestIn.txt&quot;) as Orders[];

// to write use:
CommonEngine.WriteFile(typeof(Orders), "TestOut.txt", res);

// to transform a file:
CommonEngine.TransformFile("in.txt"), typeof(FromClass), "our.txt"), typeof(ToClass));

// or the faster:
CommonEngine.TransformFileAsync("in.txt"), typeof(FromClass), "our.txt"), typeof(ToClass));

// sorting records:
CommonEngine.SortRecordsByField(customers, "CustomerName");

// generic CsvFiles ops:

CommonEngine.CsvToDataTable("customers.csv", ',');
CommonEngine.DataTableToCsv(dt, "customers.csv", ',');

// remove duplicates:
Customers[] distinct = CommonEngine.RemoveDuplicateRecords(customersArray);


// Records to DataTable
DataTable dt = CommonEngine.RecordsToDataTable(records);

// only 25 records
DataTable dt = CommonEngine.RecordsToDataTable(records, 25); 

</textarea>
          </blockquote>
          <b>Remember that you lose functionality if you use this engine, for example encoding, error handling and others.</b>
  </blockquote>

		{$FOOTER$}
</tr>
</table>


</BODY></HTML>
